/**
 * 版权所有 (C), 2019-2019, XXX有限公司
 * 项目名：com.company.study.designpatterns.combination
 * 文件名: Test
 * 日期: 2019/6/16 19:41
 * 说明:
 */
package com.company.study.designpatterns.combination;

/**
 * @author Anbang713
 * @create 2019/6/16
 */
public class Test {
    public static void main(String[] args) {
        Menu home = new Menu("首页", "/");
        Menu tag = new Menu("标签", "/标签");
        Menu archive = new Menu("归档", "/归档");
        Menu menu1 = new Menu("子菜单1", "/子菜单1");
        Menu menu2 = new Menu("子菜单2", "/子菜单2");
        home.add(tag);
        home.add(archive);
        tag.add(menu1);
        archive.add(menu2);
        home.getMenus().forEach(menu -> {
            System.out.println(menu);
        });
    }

}